﻿@page "/"
@inject HttpClient Http
@using System.Text.Json

<h1>Hello, world!</h1>

Welcome to your new app.

<SurveyPrompt Title="How is Blazor working for you?" />

<hr />

<div>
    <JsonHighlight Element="element"></JsonHighlight>
</div>

@code{
    private JsonElement element;

    protected override async Task OnInitializedAsync()
    {
        string json = await Http.GetStringAsync("sample-data/news.json");
        var doc = JsonDocument.Parse(json);
        element = doc.RootElement;
    }
}